package com.lonton.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.lonton.dao.UserDao;
import com.lonton.domain.Employee;
import com.lonton.service.EmployeeService;

@RestController
public class EmpployeeController {
	@Autowired
	private EmployeeService employeeService;
	@Autowired
	private UserDao userDao;
	@GetMapping(path="/insert")
	@Transactional
	public void insertEmp() {
		Employee employee = new Employee();
		employee.setId(22);
		employee.setAge(30);
		employee.setName("猪猪乾坤屁");
		employeeService.insertEmp(employee);
	}
	
	@GetMapping(path="/findAll")
	public List<Employee> findAll(){
		return employeeService.findAll();
	}
	
	@GetMapping(path="/first/some")
	public String first(){
		return "first";
	}
	@GetMapping(path="/second/some")
	public String second(){
		return "second";
	}

}
